//练习
import com.sun.xml.internal.ws.api.model.wsdl.WSDLOutput;
import org.w3c.dom.ls.LSOutput;

import java.sql.SQLOutput;
import java.util.Scanner;
public class test_01 {
    public static void main(String[] args) {
        int a = 10;
        int b = 20;
        System.out.println("a:"+a+",b:"+b); //a=10,b=10
        change(a,b);
        System.out.println("a:"+a+",b:"+b); //a=10,b=20
        int [] arr = {1,2,3,4,5};
        change(arr);
        System.out.println(arr[1]);         //4
    }
    public static void change(int a,int b) {
        System.out.println("a:"+a+",b:"+b); //a=10.b=20
        a = b;                              //a=b=20,b=20
        a = a+b;                            //a=a+b=40,b=20
        System.out.println("a:"+a+",b:"+b); //a=40,b=20  到这步方法调用完成
    }

    public static void change(int [] arr) {
        for(int x = 0;x < arr.length;x++){  //1,2,3,4,5
            if(arr[x]%2==0){                //1,4,3,8,5
                arr[x]*=2;                  //引用数据类型的值传递
            }
        }
    }
}
